﻿#pragma once
#include "stdint.h"
#include "vector"
#include "Connect.h"
class ConnectPayload
{
public:
	inline void SetCmd(uint8_t c) { cmd = c; }
	inline void SetHandle(uint32_t h) { handle = h & 0x00ffffff; }
	inline void SetData(const uint8_t* d, uint16_t size) { data.resize(size); memcpy(data.data(), d, size); }
	uint8_t GetCmd() const { return cmd; }
	uint32_t GetHandle() const { return handle; }
	const std::vector<uint8_t>& GetData() const { return data; }
	int Pack(uint8_t* connectPayload) const;
private:
	uint8_t cmd = 0;
	uint32_t handle;
	std::vector<uint8_t> data;
};

